<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>LoadSprite</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">LoadSprite()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#006666"><b>LoadSprite</b></font>(#Sprite, Filename$ [, Mode])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Load the specified sprite into memory for immediate use. A screen should be opened with <a href="../screen/openscreen.html">OpenScreen()</a> or 
<a href="../screen/openwindowedscreen.html">OpenWindowedScreen()</a> before loading a sprite. 
<br>
<br>
The sprite can be in BMP format or any other format supported by the <a href="../imageplugin/index.html">ImagePlugin library</a>. 
The following functions can be used to enable automatically more image formats: 
<br>
<br>
<a href="../imageplugin/usejpegimagedecoder.html">UseJPEGImageDecoder()</a> 
<br>
<a href="../imageplugin/usejpeg2000imagedecoder.html">UseJPEG2000ImageDecoder()</a> 
<br>
<a href="../imageplugin/usepngimagedecoder.html">UsePNGImageDecoder()</a> 
<br>
<a href="../imageplugin/usetiffimagedecoder.html">UseTIFFImageDecoder()</a> 
<br>
<a href="../imageplugin/usetgaimagedecoder.html">UseTGAImageDecoder()</a> 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Sprite</i></td>
<td width="90%"> 
 
A number to identify the new loaded sprite. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

 

</td></tr>
<tr><td><i>Filename$</i></td>
<td> 
 
Name of the image file used to create the sprite. 

 

</td></tr>
<tr><td><i>Mode (optional)</i></td>
<td> 
 
It can be a combination of the following values (with the '|' operator): 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Sprite_PixelCollision</font>: Add special information to handle pixel collision trough <a href="spritepixelcollision.html">SpritePixelCollision()</a>.
  <font color="#924B72">#PB_Sprite_AlphaBlending</font> : Sprite is created with per pixel alpha-channel support, needed for <a href="displaytransparentsprite.html">DisplayTransparentSprite()</a>.
                            The image format has to support it (only PNG and TIFF for now).
</font></pre>

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Nonzero if the sprite has been loaded, zero otherwise. If <font color="#924B72">#PB_Any</font> was used 
for the #Sprite parameter then the generated number is returned on success. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



Sprites shouldn't be larger than the used screenmode. Using larger sprites possibly works on some 
hardware, on others not. Better split your large sprite to several smaller ones. 

 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=issprite.html>IsSprite()</a> - <a href=index.html>Sprite Index</a> - <a href=rotatesprite.html>RotateSprite()</a> -&gt;



</body></html>